import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		hasLogin: false,
		userInfo: null,
		selectInfo:	null,
	},

	mutations: {
		/**
		 * 登录数据
		 * @param {Object} state
		 * @param {Object} provider
		 */
		login(state, provider) {
			state.hasLogin = true;
			state.userInfo = provider;
		},
		
		/**
		 * 
		 * @param {Object} state
		 * @param {Object} provider
		 */
		loginOut(state, provider) {
			state.hasLogin = false;
			state.userInfo = null;
		},
		
		setSelectInfo(state, provider) {
			state.selectInfo = provider;
		}
	},
	actions: {

	}
})

export default store
